package com.boarsoft.dao.sharding.gaussdb.mybatis.inspector;

public class RouteCondition {

	private static final ThreadLocal<RouteParameters> routeParams = ThreadLocal.withInitial(() -> null);

	public RouteCondition() {
	}

	public static RouteParameters newRouteParameters() {
		RouteParameters routeParameters = new RouteParameters();
		setRouteParameters(routeParameters);
		return routeParameters;
	}

	public static RouteParameters getRouteParameters() {
		return (RouteParameters) routeParams.get();
	}

	public static void setRouteParameters(RouteParameters routeParameters) {
		routeParams.set(routeParameters);
	}

	public static void clear() {
		routeParams.remove();
	}

}
